import request from '@/utils/request'

// 创建段别物料绑定
export function createSegmentMaterial(data) {
  return request({
    url: '/lamp/segment-material/create',
    method: 'post',
    data: data
  })
}

// 更新段别物料绑定
export function updateSegmentMaterial(data) {
  return request({
    url: '/lamp/segment-material/update',
    method: 'put',
    data: data
  })
}

// 删除段别物料绑定
export function deleteSegmentMaterial(id) {
  return request({
    url: '/lamp/segment-material/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除段别物料绑定 */
export function deleteSegmentMaterialList(ids) {
  return request({
    url: `/lamp/segment-material/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得段别物料绑定
export function getSegmentMaterial(id) {
  return request({
    url: '/lamp/segment-material/get?id=' + id,
    method: 'get'
  })
}

// 获得段别物料绑定分页
export function getSegmentMaterialPage(params) {
  return request({
    url: '/lamp/segment-material/page',
    method: 'get',
    params
  })
}
// 导出段别物料绑定 Excel
export function exportSegmentMaterialExcel(params) {
  return request({
    url: '/lamp/segment-material/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}